// 试验管理流程接口
import {
  request,
} from "@/utils/request";
let userinfo = JSON.parse(sessionStorage.getItem('userInfo'))
let userId = ''
let organizationId = 0;
if (userinfo) {
  organizationId = userinfo.tenantId
  userId = userinfo.loginName
}
//  产品关键变更配置表
export function getSampleConfig(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getSampleConfig',
    method: 'post',
    data: parameter
  })
}
// 获取试验验证需求关联产品故障
export function getCpgz(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getCpgz',
    method: 'post',
    data: parameter
  })
}
// 获取试验验证需求关联产品故障
export function getCptd(parameter) {
    return request({
      url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getCptd',
      method: 'post',
      data: parameter
    })
  }
// 项目节点
export function getSyjd(parameter) {
    return request({
      url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getSyjd',
      method: 'post',
      data: parameter
    })
  }
// 获取试验申请单基本信息
export function getTDMRequestInfo(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMRequestInfo',
    method: 'post',
    data: parameter
  })
}
//获取试验申请单样品列表信息
export function getSample(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getSample',
    method: 'post',
    data: parameter
  })
}
//获取试验申请单相关对象列表信息
export function getTDMRequestRefObj(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMRequestRefObj',
    method: 'post',
    data: parameter
  })
}
//获取试验申请单附件列表信息(同试验验证)
export function getTDMAttachment(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMAttachment',
    method: 'post',
    data: parameter
  })
}
//获取试验不合格项措施项基本信息
export function getTDMUnqualifiedStrategyInfo(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMUnqualifiedOrStrategyInfo',
    method: 'post',
    data: parameter
  })
}
//获取试验问题/措施项基本信息
export function getTDMProblemOrStrategyInfo(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMProblemOrStrategyInfo',
    method: 'post',
    data: parameter
  })
}
//问题列表流程
export function getTDMItemProblemStrategyList(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMItemProblemStrategyList',
    method: 'post',
    data: parameter
  })
}
//问题列表删除
export function deleteTDMProblemStrategy(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/deleteTDMProblemStrategy',
    method: 'post',
    data: parameter
  })
}
//问题列表下载模板
export function downloadProblemStrategyTemplate(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/downloadProblemStrategyTemplate',
    method: 'post',
    data: parameter,
    responseType: 'blob' //服务器返回的数据类型
  })
}
//问题列表导入
export function importProblemStrategy(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/importProblemStrategy',
    method: 'post',
    data: parameter
  })
}
//tdmError流程错误信息
export function getTDMIntegrationMessage(parameter) {
  return request({
    url: '/project/Windchill/servlet/rest/hzero/pmgt/tdm/getTDMIntegrationMessage',
    method: 'post',
    data: parameter
  })
}